# Contributor:  Jeff Bilyk <jbilyk@gmail.com>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-test-mockobject
_pkgname=Test-MockObject
pkgver=1.20200122
pkgrel=1
pkgdesc="Perl Mock part of an object or class"
url="https://metacpan.org/release/Test-MockObject/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
makedepends="perl-dev"
checkdepends="perl-test-warn perl-test-exception perl-universal-isa perl-universal-can"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/C/CH/CHROMATIC/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="05c0e007a22cbf24e5566e2045797b26dcadac697c8f0025422ded0c3ca03fa71d9df0149a28a97ea1454a27c77d22c46a80e705fbc309386b7d3220acd03c5f  Test-MockObject-1.20200122.tar.gz"
